package com.id.coinscleaner

import android.app.Application
import android.content.Context
import com.id.coinscleaner.utils.Events
import com.id.coinscleaner.utils.FirebaseEventsService
import com.id.coinscleaner.utils.MetricaEventsService
import com.revenuecat.purchases.Purchases
import com.revenuecat.purchases.PurchasesConfiguration
import com.tencent.mmkv.MMKV


/**
 * Created by YiGo on 2022/7/11.
 */
class App : Application() {
    companion object {
        lateinit var appContext: Context
        val DataStore: MMKV get() = MMKV.defaultMMKV()
    }

    override fun onCreate() {
        super.onCreate()
        appContext = applicationContext
        MMKV.initialize(appContext)
        Events.initialize(
            FirebaseEventsService(this@App),
            MetricaEventsService(this@App, "bca11095-b664-4af2-99c5-0c84a871e208")
        )
        Purchases.configure(
            PurchasesConfiguration.Builder(this, "goog_rbTfxoGZHySgEdNLdUvdLwkiEHa")
                .observerMode(false)
                .appUserID(null)
                .build()
        )
    }


}